package cn.fws.meap.community.service.impl;

import cn.fws.framework.utils.UUIDUtils;
import cn.fws.meap.community.entity.ProblemResources;
import cn.fws.meap.community.mapper.ProblemResourcesMapper;
import cn.fws.meap.community.service.IProblemResourcesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class ProblemResourcesServiceImpl implements IProblemResourcesService {
    @Autowired
    private ProblemResourcesMapper problemResourcesMapper;

    /**
     * 添加中间表数据
     * @param resourceId
     * @param problemId
     */
    @Override
    public void insert(String resourceId,String problemId) {
        ProblemResources pr=new ProblemResources();
        String uuid = UUIDUtils.getUUID();
        pr.setCreateTime(new java.util.Date());
        pr.setId(uuid);
        pr.setResourcesId(resourceId);
        pr.setProblemId(problemId);
        problemResourcesMapper.insert(pr);
    }
}
